# pylint: disable-msg=E1101
"""
@author: Sergiy Tsymbalyuk
"""

import logging

from pylons.i18n import lazy_ugettext as _

from repoze.what.plugins.pylonshq import ControllerProtector
from repoze.what.predicates import has_permission

from chowa.lib.site.crud import FlatCrudController
from chowa.model.abstract import Person
from hrms.model.person import Employee

from hrms.lib.base import BaseController, render, Session

log = logging.getLogger(__name__)

@ControllerProtector(has_permission('site.administer.organization'))
class EmployeesController(FlatCrudController):
    __model__ = Employee
    __columns__ = ['person.surname',
                   'person.name',
                   'person.patronymic',
                   'person.born',
                   'position']
    __edit_columns__ = ['surname',
                        'name',
                        'patronymic',
                        'born',
                        'gender',
                        'division',
                        'position',
                        'office',
                        'is_employee']
    __order__ = ['is_employee', 'surname', 'name', 'patronymic']
